package com.huiyeji.hui.entity;

import java.time.LocalDateTime;

/**
 * @author zhaoduo
 */
public class Invitation {

    private Long id;

    private Long sender;

    private Long receiver;

    private Long gid;

    private Byte type;

    private LocalDateTime createTime;

    /**
     * 0->初始状态
     * 1->已同意
     * 2->已拒绝
     */
    private Byte status;

    public Invitation() {
    }

    public Invitation(Long id, Long sender, Long receiver, Long gid, Byte type, LocalDateTime createTime, Byte status) {
        this.id = id;
        this.sender = sender;
        this.receiver = receiver;
        this.gid = gid;
        this.type = type;
        this.createTime = createTime;
        this.status = status;
    }

    public static Invitation buildGroupInvitation(LocalDateTime createTime){
        return new Invitation(
                null,
                null,
                null,
                null,
                Byte.parseByte("2"),
                createTime,
                Byte.parseByte("0"));
    }

    public static Invitation buildFriendInvitation(LocalDateTime createTime){
        return new Invitation(
                null,
                null,
                null,
                null,
                Byte.parseByte("1"),
                createTime,
                Byte.parseByte("0"));
    }

    public Long getGid() {
        return gid;
    }

    public void setGid(Long gid) {
        this.gid = gid;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSender() {
        return sender;
    }

    public void setSender(Long sender) {
        this.sender = sender;
    }

    public Long getReceiver() {
        return receiver;
    }

    public void setReceiver(Long receiver) {
        this.receiver = receiver;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

}
